package com.example.uiclassassignments.Activity;

import android.app.ProgressDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.uiclassassignments.R;

public class ProgressBarActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_progressbar);
    }

    public void btn(View view) {
        ProgressDialog progressDialog = new ProgressDialog(this);
        progressDialog.setCanceledOnTouchOutside(false);
        progressDialog.show();
        view = LayoutInflater.from(this).inflate(R.layout.progressdialog_layout, null);
        ImageView animImage = (ImageView)view.findViewById(R.id.animImage);
        Animation animationProgress = AnimationUtils.loadAnimation(this,R.anim.progress);
        animImage.startAnimation(animationProgress);
        TextView  textView = (TextView)view.findViewById(R.id.tvTip);
        textView.setText("is loading!!!!");
        progressDialog.setContentView(view);
    }

}
